// 路由-相关模块
import Vue from 'vue'
import VueRouter from 'vue-router'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import Search from '@/views/Search'
import Play from '@/views/Play'
import Category from "@/views/Category"
import Singer from "@/views/Singer"
const LookMusic = () => import('@/components/LookMusic')
const MusicSheetList = () => import('@/views/musiclist/MusicSheetList')
Vue.use(VueRouter)
const routes = [
    {
        path: '/',
        redirect: '/layout'
    },
    {
        path: '/MusicSheetList',
        name: 'MusicSheetList',
        component: MusicSheetList
    },
    {
        path: '/LookMusic',
        name: 'LookMusic',
        component: LookMusic
    },
    {
        path: '/layout',
        component: Layout,
        redirect: '/layout/home',
        children: [
            {
                path: 'home',
                component: Home,
                meta: { // meta保存路由对象额外信息的
                    title: "网易云音乐"
                }
            },
            {
                path: 'search',
                component: Search,
                meta: {
                    title: "搜索"
                }
            },
            {
                path: 'category',
                component: Category,
                meta: {
                    title: "歌单分类",// true显示，false隐藏
                }
            },
            {
                path: 'singer',
                component: Singer,
                meta: {
                    title: "全部歌手",// true显示，false隐藏
                }
            },
        ]
    },
    {
        path: '/play',
        component: Play
    }
]

const router = new VueRouter({
    routes
})

export default router